package cn.ransj.animation.util;

import java.util.Random;

import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;

/**
 * alpha aimation utils
 * 
 * @author android
 * 
 */
class AlphaUtil implements AnimInterface {
	private static final String TAG = AlphaUtil.class.getSimpleName();
	private static final float[][] ACTIONS = { { (float) 1.0, 0 },
			{ 0, (float) 1.0 } };
	private int mActionLength;
	private Random mRandom;

	public void init() {
		mRandom = new Random();
		mActionLength = ACTIONS.length;
	}

	public Animation random() {
		int index = mRandom.nextInt(mActionLength);
		Animation ani = new AlphaAnimation(ACTIONS[index][0],
				ACTIONS[index][1]);
		return ani;
	}

}
